(window.zowieJsonp=window.zowieJsonp||[]).push([[11],[,,,,,,,function(e,t,n){"use strict";var r={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},o=function(e){for(var t=[],n=1;n>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,_)}function T(e){return 0!==e&&100*Math.random()<=e}function L(){}function P(e,t,n){if("object"!==typeof e||null===e)return JSON.stringify(e);var r=N(Object.prototype),o=N(Array.prototype),a=N(Object.getPrototypeOf(e)),i=N(e);try{return JSON.stringify(e,t,n)}catch(e){return""}finally{r(),o(),a(),i()}}function N(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):L}function R(e,t){return-1!==e.indexOf(t)}function O(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach(function(e){return t.push(e)});else for(var n=0;n=0&&e<=100}function I(e){return"number"===typeof e}function M(e){return Object.keys(e).map(function(t){return e[t]})}function F(e){return 0===Object.keys(e).length}function D(e,t){return e.slice(0,t.length)===t}function U(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return"".concat(e.protocol,"//").concat(t)}function A(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function j(e,t,n){if(void 0===n&&(n=function(){if("undefined"!==typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!==typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],a=0;at)){for(;a.length>0&&ut){ee(t,"truncated",e);break}s.target[f]=d}else for(var f in s.source)if(Object.prototype.hasOwnProperty.call(s.source,f)){var d;if(void 0!==(d=Z(s.source[f],s.path,f,a,i))&&(u+=JSON.stringify(d).length+c+f.length+X,c=1),u>t){ee(t,"truncated",e);break}s.target[f]=d}}return r(),o(),l}ee(t,"discarded",e)}function Z(e,t,n,r,o){var a=function(e){var t=e;if(t&&"function"===typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!a||"object"!==typeof a)return function(e){if("bigint"===typeof e)return"[BigInt] ".concat(e.toString());if("function"===typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"===typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(a);var i=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e),n=t.match(/\[object (.*)\]/);if(n&&n[1])return"[".concat(n[1],"]")}catch(e){}return"[Unserializable]"}(a);if("[Object]"!==i&&"[Array]"!==i)return i;var l=e;if(o.has(l))return"[Reference seen at ".concat(o.get(l),"]");var u=void 0!==n?"".concat(t,".").concat(n):t,s=Array.isArray(a)?[]:{};return o.set(l,u),r.push({source:a,target:s,path:u}),s}function ee(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var te=200;function ne(e,t){void 0===t&&(t=q);var n,r={},a=!1,i=x(function(r){n=t(P(r)),a||(a=function(e,t){return e>G&&(o.warn("The ".concat(t," data is over ").concat(G/S,"KiB. On low connectivity, the SDK has the potential to exhaust the user's upload bandwidth.")),!0)}(n,e))},te).throttled;return{getBytesCount:function(){return n},get:function(){return r},add:function(e,t){r[e]=t,i(r)},remove:function(e){delete r[e],i(r)},set:function(e){i(r=e)},getContext:function(){return B(r)},setContext:function(e){r=Q($.SANITIZE_INPUTS)?J(e):B(e),i(r)},setContextProperty:function(e,t){r[e]=Q($.SANITIZE_INPUTS)?J(t):B(t),i(r)},removeContextProperty:function(e){delete r[e],i(r)},clearContext:function(){r={},n=0}}}var re,oe=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach(function(e){return e()}),this.buffer.length=0},e}();function ae(){return(new Date).getTime()}function ie(){return ae()}function le(){return performance.now()}function ue(){return{relative:le(),timeStamp:ie()}}function se(){return void 0===re&&(re=performance.timing.navigationStart),re}function ce(){var e=h().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function fe(e){var t;void 0===e&&(e=null===(t=h().location)||void 0===t?void 0:t.hostname);var n=ce();return!!n&&n.getAllowedWebViewHosts().some(function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r})}function de(e){var t=C({},e);return["id","name","email"].forEach(function(e){e in t&&(t[e]=String(t[e]))}),t}var pe,he,ve=b;function me(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var a="expires=".concat(o.toUTCString()),i=r&&r.crossSite?"none":"strict",l=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"";document.cookie="".concat(e,"=").concat(t,";").concat(a,";path=/;samesite=").concat(i).concat(l).concat(u)}function ge(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*".concat(t,"\\s*=\\s*([^;]+)")).exec(e);return n?n[1]:void 0}(document.cookie,e)}function ye(e,t){me(e,"",0,t)}function be(e){return we(e,U(window.location)).href}function we(e,t){if(function(){if(void 0!==he)return he;try{var e=new URL("http://test/path");return he="http://test/path"===e.href}catch(e){he=!1}return he}())try{return void 0!==t?new URL(e,t):new URL(e)}catch(n){throw new Error("Failed to construct URL. ".concat(P({url:e,base:t})))}if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var ke="datad0g.com",Se="datadoghq.com",Ee="ap1.datadoghq.com",xe={logs:"logs",rum:"rum",sessionReplay:"session-replay"},Ce={logs:"logs",rum:"rum",sessionReplay:"replay"};function _e(e,t,n){var r=function(e,t){var n="/api/v2/".concat(Ce[t]),r=e.proxy,o=e.proxyUrl;if(r){var a=be(r);return function(e){return"".concat(a,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(e)))}}var i=function(e,t){var n=e.site,r=void 0===n?Se:n,o=e.internalAnalyticsSubdomain;if(o&&r===Se)return"".concat(o,".").concat(Se);var a=r.split("."),i=a.pop(),l=r!==Ee?"".concat(xe[t],"."):"";return"".concat(l,"browser-intake-").concat(a.join("-"),".").concat(i)}(e,t);if(void 0===r&&o){var l=be(o);return function(e){return"".concat(l,"?ddforward=").concat(encodeURIComponent("https://".concat(i).concat(n,"?").concat(e)))}}return function(e){return"https://".concat(i).concat(n,"?").concat(e)}}(e,t);return{build:function(o,a,i){var l=function(e,t,n,r,o,a){var i=e.clientToken,l=e.internalAnalyticsSubdomain,u=["sdk_version:".concat("4.38.0"),"api:".concat(r)].concat(n);o&&Q($.COLLECT_FLUSH_REASON)&&u.push("flush_reason:".concat(o));a&&u.push("retry_count:".concat(a.count),"retry_after:".concat(a.lastFailureStatus));var s=["ddsource=browser","ddtags=".concat(encodeURIComponent(u.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("4.38.0")),"dd-evp-origin=browser","dd-request-id=".concat(_())];"rum"===t&&s.push("batch_time=".concat(ie()));l&&s.reverse();return s.join("&")}(e,t,n,o,a,i);return r(l)},urlPrefix:r(""),endpointType:t}}var Te=200;var Le=/[^a-z0-9_:./-]/;function Pe(e,t){var n=Te-e.length-1;(t.length>n||Le.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function Ne(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,a=[];return t&&a.push(Pe("env",t)),n&&a.push(Pe("service",n)),r&&a.push(Pe("version",r)),o&&a.push(Pe("datacenter",o)),a}(e),n=function(e,t){return{logsEndpointBuilder:_e(e,"logs",t),rumEndpointBuilder:_e(e,"rum",t),sessionReplayEndpointBuilder:_e(e,"sessionReplay",t)}}(e,t),r=M(n).map(function(e){return e.urlPrefix});return C({isIntakeUrl:function(e){return r.some(function(t){return 0===e.indexOf(t)})},replica:function(e,t,n){if(!e.replica)return;var r=C({},e,{site:Se,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:_e(r,"logs",n),rumEndpointBuilder:_e(r,"rum",n)};return t.push.apply(t,M(o).map(function(e){return e.urlPrefix})),C({applicationId:e.replica.applicationId},o)}(e,r,t),site:e.site||Se},n)}function Re(e){var t,n,r;if(e&&e.clientToken){var i=null!==(t=e.sessionSampleRate)&&void 0!==t?t:e.sampleRate;if(void 0===i||z(i))if(void 0===e.telemetrySampleRate||z(e.telemetrySampleRate)){if(void 0===e.telemetryConfigurationSampleRate||z(e.telemetryConfigurationSampleRate))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter(function(e){return t=$,n=e,Object.keys(t).some(function(e){return t[e]===n});var t,n}).forEach(function(e){W.add(e)}),C({beforeSend:e.beforeSend&&a(e.beforeSend,"beforeSend threw an error:"),cookieOptions:function(e){var t={};t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===pe){for(var e="dd_site_test_".concat(_()),t=window.location.hostname.split("."),n=t.pop();t.length&&!ge(e);)n="".concat(t.pop(),".").concat(n),me(e,"test",b,{domain:n});ye(e,{domain:n}),pe=n}return pe}());return t}(e),sessionSampleRate:null!==i&&void 0!==i?i:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,batchBytesLimit:16*S,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*b,batchMessagesLimit:50,messageBytesLimit:256*S},Ne(e));o.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else o.error("Telemetry Sample Rate should be a number between 0 and 100");else o.error("Session Sample Rate should be a number between 0 and 100")}else o.error("Client Token is not configured, we will not send any data.")}var Oe="?";function ze(e){var t=[],n=Be(e,"stack"),r=String(e);return n&&D(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach(function(e){var n=function(e){var t=Me.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=Fe.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Oe,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=De.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:Oe,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=Ue.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Oe,line:+t[3],url:t[2]}}(e)||function(e){var t=Ae.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=je.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Oe,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=Oe),t.push(n))}),{message:Be(e,"message"),name:Be(e,"name"),stack:t}}var Ie="((?:file|https?|blob|chrome-extension|native|eval|webpack||\\w+\\.|\\/).*?)",Me=new RegExp("^\\s*at (.*?) ?\\(".concat(Ie).concat("(?::(\\d+))","?").concat("(?::(\\d+))","?\\)?\\s*$"),"i"),Fe=new RegExp("\\((\\S*)".concat("(?::(\\d+))").concat("(?::(\\d+))","\\)"));var De=new RegExp("^\\s*at ?".concat(Ie).concat("(?::(\\d+))","?").concat("(?::(\\d+))","??\\s*$"),"i");var Ue=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Ae=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,je=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Be(e,t){if("object"===typeof e&&e&&t in e){var n=e[t];return"string"===typeof n?n:void 0}}var He={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function $e(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,a=e.nonErrorPrefix,i=e.source,l=e.handling;if(!t||void 0===t.message&&!(n instanceof Error)){var u=Q($.SANITIZE_INPUTS)?J(n):n;return{startClocks:o,source:i,handling:l,originalError:u,message:"".concat(a," ").concat(P(u)),stack:"No stack, consider using an instance of Error",handlingStack:r,type:t&&t.name}}return{startClocks:o,source:i,handling:l,originalError:n,message:t.message||"Empty message",stack:Ve(t),handlingStack:r,type:t.name,causes:function(e,t){var n=e,r=[];for(;(null===n||void 0===n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ze(n.cause);r.push({message:n.cause.message,source:t,type:null===o||void 0===o?void 0:o.name,stack:o&&Ve(o)}),n=n.cause}return r.length?r:void 0}(n,i)}}function Ve(e){var t=qe(e);return e.stack.forEach(function(e){var n="?"===e.func?"":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",a=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(a)}),t}function qe(e){return"".concat(e.name||"Error",": ").concat(e.message)}var We=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter(function(t){return e!==t}),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach(function(t){return t(e)})},e}();function Qe(){for(var e=[],t=0;t=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)}}(e))}),n=Ge(document,"securitypolicyviolation",e).stop;return n}));var r=e.filter(function(e){return e!==Ye.cspViolation});return r.length&&n.push(function(e){var t=new We(function(){if(window.ReportingObserver){var n=f(function(e){return e.forEach(function(e){var n,r,o;t.notify((r=(n=e).type,o=n.body,{type:r,subtype:o.id,message:"".concat(r,": ").concat(o.message),stack:Je(o.id,o.message,o.sourceFile,o.lineNumber,o.columnNumber)}))})}),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}});return t}(r)),Qe.apply(void 0,n)}function Je(e,t,n,r,o){return n&&Ve({name:e,message:t,stack:[{func:"?",url:n,line:r,column:o}]})}var Ze=32*S;function et(e,t,n){if(void 0===e)return[];var r,a;{if("all"===e||Array.isArray(e)&&e.every(function(e){return R(t,e)}))return"all"===e?t:(r=e,a=new Set,r.forEach(function(e){return a.add(e)}),O(a));o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'))}}var tt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},nt={debug:"debug",error:"error",info:"info",warn:"warn"},rt={console:"console",http:"http",silent:"silent"},ot=Object.keys(nt),at=function(){function e(e,t,n,r,o){void 0===n&&(n=rt.http),void 0===r&&(r=nt.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager=ne("logger context"),this.contextManager.set(C({},o,t?{logger:{name:t}}:void 0))}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=nt.info),n===nt.error&&(o={origin:He.LOGGER}),void 0!==r&&null!==r){var a=$e({stackTrace:r instanceof Error?ze(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:He.LOGGER,handling:"handled",startClocks:ue()});o={origin:He.LOGGER,stack:a.stack,kind:a.type,message:a.message}}var i=Q($.SANITIZE_INPUTS)?J(t):B(t),l=o?H({error:o},i):i;this.handleLogStrategy({message:Q($.SANITIZE_INPUTS)?J(e):e,context:l,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,nt.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,nt.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,nt.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,nt.error,n)},e.prototype.setContext=function(e){this.contextManager.set(e)},e.prototype.getContext=function(){return this.contextManager.get()},e.prototype.addContext=function(e,t){this.contextManager.add(e,t)},e.prototype.removeContext=function(e){this.contextManager.remove(e)},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},tt([c],e.prototype,"log",null),e}();function it(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var lt={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var ut="datadog-synthetics-public-id",st="datadog-synthetics-result-id",ct="datadog-synthetics-injects-rum";function ft(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||ge(ct))}var dt,pt={log:"log",configuration:"configuration"},ht=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","http://localhost",""],vt=["ddog-gov.com"],mt={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function gt(e,t){var n,r=new We;return mt.telemetryEnabled=!R(vt,t.site)&&T(t.telemetrySampleRate),mt.telemetryConfigurationEnabled=mt.telemetryEnabled&&T(t.telemetryConfigurationSampleRate),dt=function(t){if(mt.telemetryEnabled){var o=function(e,t){return H({type:"telemetry",date:ie(),service:e,version:"4.38.0",source:"browser",_dd:{format_version:2},telemetry:t,experimental_features:O(W)},void 0!==n?n():{})}(e,t);r.notify(o),it("telemetry",o)}},i=yt,C(mt,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:mt.telemetryEnabled}}function yt(e){bt(C({type:pt.log,status:"error"},function(e){if(e instanceof Error){var t=ze(e);return{error:{kind:t.name,stack:Ve(function(e){return e.stack=e.stack.filter(function(e){return!e.url||ht.some(function(t){return D(e.url,t)})}),e}(t))},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught ".concat(P(e))}}(e)))}function bt(e){dt&&mt.sentEventCount=this.messageBytesLimit?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(a)&&this.flush("batch_bytes_limit"),this.push(r,a,t),this.isFull()&&this.flush("batch_bytes_limit"))},e.prototype.process=function(e){var t=P(e);return{processedMessage:t,messageBytesCount:q(t)}},e.prototype.push=function(e,t,n){this.bufferMessagesCount>0&&(this.bufferBytesCount+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesCount+=t,this.bufferMessagesCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=q(t);this.bufferBytesCount-=n,this.bufferMessagesCount-=1,this.bufferMessagesCount>0&&(this.bufferBytesCount-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesCount+e+1>=this.batchBytesLimit},e.prototype.isFull=function(){return this.bufferMessagesCount===this.batchMessagesLimit||this.bufferBytesCount>=this.batchBytesLimit},e.prototype.flushPeriodically=function(){var e=this;m(function(){e.flush("batch_duration_limit"),e.flushPeriodically()},this.flushTimeout)},e}(),kt=80*S,St=32,Et=3*E,xt=w,Ct=b;function _t(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Tt(e,t,n,{onSuccess:function(){return Lt(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),function e(t,n,r,o){if(2!==t.transportStatus)return;m(function(){var a=t.queuedPayloads.first();Tt(a,t,n,{onSuccess:function(){t.queuedPayloads.dequeue(),t.currentBackoffTime=Ct,Lt(1,t,n,r,o)},onFailure:function(){t.currentBackoffTime=Math.min(xt,2*t.currentBackoffTime),e(t,n,r,o)}})},t.currentBackoffTime)}(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Tt(e,t,n,r){var o=r.onSuccess,a=r.onFailure;t.bandwidthMonitor.add(e),n(e,function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||e.status>=500)}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},a())})}function Lt(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(Et/E,"MiB"),source:He.AGENT,startClocks:ue()}),t.queueFullReported=!0);var a=t.queuedPayloads;for(t.queuedPayloads=Nt();a.size()>0;)_t(a.dequeue(),t,n,r,o)}function Pt(){return{transportStatus:0,currentBackoffTime:Ct,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=kt&&this.ongoingRequestCount=Et}}}function Rt(e,t,n){var r=Pt(),o=function(n,r){return function(e,t,n,r){var o=n.data,a=n.bytesCount,i=n.flushReason,l=n.retry;if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&a=0&&n.entries.splice(e,1)},close:function(e){r.endTime=e}};return this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=1/0);for(var t=0,n=this.entries;t0&&this.entries[this.entries.length-1].endTime=Vt)Kt();else{var r,o=Jt();if(Qt()){if(o.lock)return void Gt(e,t);if(r=_(),o.lock=r,Xt(o,e.options),(o=Jt()).lock!==r)return void Gt(e,t)}var a=e.process(o);if(Qt()&&(o=Jt()).lock!==r)Gt(e,t);else{if(a&&Yt(a,e.options),Qt()&&(!a||!en(a))){if((o=Jt()).lock!==r)return void Gt(e,t);delete o.lock,Xt(o,e.options),a=o}null===(n=e.after)||void 0===n||n.call(e,a||o),Kt()}}else qt.push(e)}function Qt(){return!!window.chrome||/HeadlessChrome/.test(window.navigator.userAgent)}function Gt(e,t){m(function(){Wt(e,t+1)},$t)}function Kt(){Dt=void 0;var e=qt.shift();e&&Wt(e)}function Yt(e,t){en(e)?Zt(t):(e.expire=String(ae()+At),Xt(e,t))}function Xt(e,t){me(Ht,function(e){return(t=e,Object.keys(t).map(function(e){return[e,t[e]]})).map(function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)}).join(Bt);var t}(e),At,t)}function Jt(){var e=ge(Ht),t={};return function(e){return void 0!==e&&(-1!==e.indexOf(Bt)||jt.test(e))}(e)&&e.split(Bt).forEach(function(e){var n=jt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}}),t}function Zt(e){ye(Ht,e)}function en(e){return F(e)}var tn="_dd",nn="_dd_r",rn="_dd_l",on="rum",an="logs";function ln(e,t,n){var r=new We,o=new We,a=g(function(){Wt({options:e,process:function(e){return s(e)?void 0:{}},after:l})},ve),i=function(){var e=Jt();if(s(e))return e;return{}}();function l(e){return s(e)||(e={}),u()&&(!function(e){return i.id!==e.id||i[t]!==e[t]}(e)?i=e:(i={},o.notify())),e}function u(){return void 0!==i[t]}function s(e){return(void 0===e.created||ae()-Number(e.created)=mn[n.getLevel()]&&R(o,t)}function yn(e,t,n,r,o,a){var i={};ot.concat(["custom"]).forEach(function(e){var n,r,o,l,u;i[e]=(n=e,r=t.eventRateLimiterThreshold,o=a,l=0,u=!1,{isLimitReached:function(){if(0===l&&m(function(){l=0},w),(l+=1)<=r||u)return u=!1,!1;if(l===r+1){u=!0;try{o({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:He.AGENT,startClocks:ue()})}finally{u=!1}}return!0}})}),n.subscribe(0,function(a){var l,u,s,c=a.rawLogsEvent,f=a.messageContext,d=void 0===f?void 0:f,p=a.savedCommonContext,h=void 0===p?void 0:p,v=a.logger,m=void 0===v?o:v,g=c.date-se(),y=e.findTrackedSession(g);if(y){var b=h||r(),w=H({service:t.service,session_id:y.id,usr:F(b.user)?void 0:b.user,view:b.view},b.context,wn(g),c,m.getContext(),d);!gn(c.status,rt.http,m)||!1===(null===(l=t.beforeSend)||void 0===l?void 0:l.call(t,w))||(null===(u=w.error)||void 0===u?void 0:u.origin)!==He.AGENT&&(null!==(s=i[w.status])&&void 0!==s?s:i.custom).isLimitReached()||n.notify(1,w)}})}var bn=!1;function wn(e){var t,n=window;if(ft()){var o=a(n.DD_RUM_SYNTHETICS);return o||bn||(bn=!0,function(e,t){p(r.debug,e,t),bt(C({type:pt.log,message:e,status:"debug"},t))}("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||ge(ut),"string"===typeof t?t:void 0),resultId:function(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||ge(st);return"string"===typeof e?e:void 0}()})),o}return a(n.DD_RUM);function a(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}var kn,Sn={};function En(e){var t=e.map(function(e){return Sn[e]||(Sn[e]=function(e){var t=new We(function(){var n=console[e];return console[e]=function(){for(var o=[],a=0;a=500}(r)||("xhr"in r?function(e,t,n){"string"===typeof e.response?n(An(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],a=0;function i(){var e,i;if(r.cancel().catch(L),n.collectStreamBody){var l;if(1===o.length)l=o[0];else{l=new Uint8Array(a);var u=0;o.forEach(function(e){l.set(e,u),u+=e.length})}e=l.slice(0,n.bytesLimit),i=l.length>n.bytesLimit}t(void 0,e,i)}!function e(){r.read().then(f(function(t){t.done?i():(n.collectStreamBody&&o.push(t.value),(a+=t.value.length)>n.bytesLimit?i():e())}),f(function(e){return t(e)}))}()}(e,function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}},{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)}):r.text().then(f(function(e){return n(An(e,t))}),f(function(e){return n("Unable to retrieve response: ".concat(e))})):n()}(r.response,e,o):r.error&&function(e,t,n){n(An(Ve(ze(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function An(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}var jn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function Bn(e){var t=function(e){return Pn(window,"onerror",{before:function(t,n,r,o,a){var i;if(a)i=ze(a),e(i,a);else{var l,u={url:n,column:o,line:r},s=t;if("[object String]"==={}.toString.call(t)){var c=jn.exec(s);c&&(l=c[1],s=c[2])}e(i={name:l,message:"string"===typeof s?s:void 0,stack:[u]},t)}}})}(e).stop,n=function(e){return Pn(window,"onunhandledrejection",{before:function(t){var n=t.reason||"Empty reason",r=ze(n);e(r,n)}})}(e).stop;return{stop:function(){t(),n()}}}function Hn(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n,r=new We,o=(n=r,Bn(function(e,t){n.notify($e({stackTrace:e,originalError:t,startClocks:ue(),nonErrorPrefix:"Uncaught",source:He.SOURCE,handling:"unhandled"}))})).stop,a=r.subscribe(function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,origin:He.SOURCE,stack:e.stack},origin:He.SOURCE,status:nt.error}})});return{stop:function(){o(),a.unsubscribe()}}}var $n=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach(function(e){return e(t)})},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter(function(e){return t!==e})}}},e}();n.d(t,"a",function(){return Gn}),n.d(t,!1,function(){return at}),n.d(t,!1,function(){return nt}),n.d(t,!1,function(){return rt});var Vn,qn,Wn,Qn,Gn=function(e){var t,n,a=!1,i=ne("global context"),l=ne("user"),u={},c=function(){},d=new oe,p=function(e,t,n,r){void 0===n&&(n=B(m())),void 0===r&&(r=ie()),d.add(function(){return p(e,t,n,r)})},h=function(){},v=new at(function(){for(var e=[],t=0;t